package com.bi.bitest.bao;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.MenuItem;
import com.bi.bitest.bao.fragments.AlbumDetailFragment;


public class Album_Detail_Activity extends FragmentActivity {

    private Intent intent;
    private long albumId;
    private long trackId;
    private FragmentManager manager;
    private FragmentTransaction tran;
    private AlbumDetailFragment albumDetailFragment;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_album_detail);
        intent=getIntent();
        albumId=intent.getLongExtra("albumid",-1);
        trackId=intent.getLongExtra("trackid",-1);

        manager=getSupportFragmentManager();
        tran=manager.beginTransaction();
         albumDetailFragment=AlbumDetailFragment.newInstance(albumId);
         tran.replace(R.id.container_ll_albumdetail,albumDetailFragment);
          tran.commit();

    }








    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_activity_album_detail, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
